package com.ita.pojo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.junit.Ignore;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
@Table(name = "c_addr")
@GenericGenerator(name="uuid_addr", strategy="uuid")
//@SequenceGenerator(name="seq2", sequenceName="seq02", initialValue=1, allocationSize=1)
public class Address implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	///id
	@Id
	@Column(name="id",length=36)
	@GeneratedValue(generator="uuid_addr")
	//@Column(name="id")
	private String id;
	
	private String address;
	private Integer state;
	
	@ManyToOne
	@JoinColumn(name="c_id")
	@JsonIgnore
	private User user;

	public Address() {
		super();
		// TODO Auto-generated constructor stub
	}

	public Address(String id, String address, Integer state) {
		super();
		this.id = id;
		this.address = address;
		this.state = state;
	}

	public Address(String id, String address, Integer state,
			User user) {
		super();
		this.id = id;
 
		this.address = address;
		this.state = state;
		this.user = user;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Override
	public String toString() {
		return "Address [id=" + id + ", address=" + address + ", state=" + state + "]";
	}
	
	
	
}
